<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" import="java.util.ArrayList" import="domain.PropertyScrap" %>
<%@ page import="repository.PropertyScrapDAO" import="java.sql.SQLException" import="java.sql.ResultSet" %>
<%
	List<PropertyScrap> allProperty = new ArrayList<PropertyScrap>();

	PropertyScrapDAO userDao = null;
	try {
		userDao = new PropertyScrapDAO();
	} catch (SQLException e) {
		e.printStackTrace();
	}

	ResultSet rs = userDao.queryAll();
	try {
		while (rs.next()) {
			PropertyScrap user = new PropertyScrap();
			user.setID(rs.getString("物品ID"));
			user.setName(rs.getString("物品名称"));
			user.setLocation(rs.getString("物品源属地"));
			user.setNumber(rs.getString("数量"));
			allProperty.add(user);
		}
	} catch (SQLException e) {
		e.printStackTrace();
	}

	request.setAttribute("propertySco", allProperty);
	request.getRequestDispatcher("PropertySco.jsp").forward(request, response);
%>
